<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/common/topBegin.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/js/public/Validform/css/Validform.css"/>
<link rel="stylesheet" type="text/css" href="${ctx}/js/public/Validform/css/right_yz.css"/>
 <script type="text/javascript" src="${ctx}/js/jquery-1.7.1.min.js"></script>
 <script language="JavaScript" type="text/javascript" src="${ctx}/js/public/Validform/Validform_v5.3.2.js"></script>
 <script language="JavaScript" type="text/javascript" src="${ctx}/js/public/Validform/right_Validform_v5.3.2_config.js"></script>
 <script type="text/javascript" src="${ctx}/js/ajaxfileupload.js"></script>
 <script type="text/javascript" src="${ctx}/js/extjs/ext-base.js"></script>
 <script type="text/javascript" src="${ctx}/js/extjs/ext-all.js"></script>
 <script type="text/javascript" src="${ctx}/js/extjs/ui/ext-ui.js"></script>
 <script type="text/javascript" src="${ctx}/js/public/console.js"></script>
 <script type="text/javascript" src="${ctx}/js/extjs/ux/Toast.js"></script>
<script>
var cfg = {cxt:'${ctx}'};
<c:if test="${not empty entity}">
	<c:set var="url" value="safetyCard/update.action"/>
</c:if>
<c:if test="${ empty entity}">
<c:set var="url" value="safetyCard/add.action"/>
</c:if>
</script>
</head>
<body>
<div  id="table_form_div" class="table_form1">
<form  action="${ctx}/${url}" method="post" id="formobj" enctype="multipart/form-data">
 <input type="hidden" id="subBtn"   />
 <input type="hidden" id="backTip"  value="操作成功" />
  <table class="table-form" width="100%">
   <tbody>
      <tr>
	       <td width="20%" class="table-th">安全卡编号<font color="red">*</font></td>
	       <td class="table-td" width="30%">
	           <input type="text" id="code"  class="input-text" style="width:90%;" name="code" value="${entity.code}" maxlength="16"   datatype="*" />
	       </td>
	         <td width="20%" class="table-th">说明书编号<font color="red">*</font></td>
	       <td class="table-td" width="30%">
	           <input type="text" id="code2"  class="input-text" style="width:90%;" name="code2" value="${entity.code2}" maxlength="16"    datatype="*"/>
	       </td>
	     </tr>
	     <tr>
	       <td width="15%" class="table-th">安全卡名称<font color="red">*</font></td>
	       <td class="table-td" width="35%">
	           <input type="text" id="name"  class="input-text" style="width:90%;" name="name" value="${entity.name}" maxlength="32"   datatype="*" />
	       </td>
	        <td width="15%" class="table-th">说明书名称<font color="red">*</font></td>
	       <td class="table-td" width="35%">
	           <input type="text" id="name2"  class="input-text" style="width:90%;" name="name2" value="${entity.name2}" maxlength="32"   datatype="*" />
	       </td>
	  </tr>
	   <tr>
	   		<td width="20%" class="table-th">
	   		<input type="button" id="btn_upload" value="上传安全卡" onclick="safetyCardForm.createUploadWin('safetyCard');"/>
	   		<font color="red">*</font></td>
            <td  colspan="3">
            	<div id="file_div">
            	 <c:if test="${not empty entity.path }">
            		<c:set var="files" value="${fn:split(entity.path,',')}"/>
            		<c:forEach var="item" items="${files }">
         			<c:set var="itemFile" value="${fn:substring(item,(fn:indexOf(item,'/')+1),fn:length(item))}"/>
         			<c:set var="preItemFile" value="${fn:substring(itemFile,0,fn:indexOf(itemFile,'.')) }"/>
        			<span id="sp_${preItemFile}" style="padding-left:8px;padding-right:5px;">${itemFile }</span>
        			<a id="a_${preItemFile}" href="javascript:void(0);" onclick="safetyCardForm.delFile('${itemFile}');">删除</a>
        			<input type="hidden" id="hid_${preItemFile}" value="${item }"/>
         		</c:forEach>
            	</c:if>
            	<input type="hidden" id="hid_filePath" name="path" value="${entity.path }"/>
            	<input type="file"  id="pathFile" name="file" style="display:none" />
            	</div>
			</td>
      </tr>
      
      <tr>
	   		<td width="20%" class="table-th">
	   		<input type="button" id="btn_upload" value="上传安全说明书" onclick="safetyCardForm.createUploadWin('info');"/>
	   		<font color="red">*</font></td>
            <td  colspan="3">
            	<div id="file_infoPath_div">
            	 <c:if test="${not empty entity.infoPath }">
            		<c:set var="files" value="${fn:split(entity.infoPath,',')}"/>
            		<c:forEach var="item" items="${files }">
         			<c:set var="itemFile" value="${fn:substring(item,(fn:indexOf(item,'/')+1),fn:length(item))}"/>
         			<c:set var="preItemFile" value="${fn:substring(itemFile,0,fn:indexOf(itemFile,'.')) }"/>
        			<span id="sp_${preItemFile}" style="padding-left:8px;padding-right:5px;">${itemFile }</span>
        			<a id="a_${preItemFile}" href="javascript:void(0);" onclick="safetyCardForm.delFile('${itemFile}');">删除</a>
        			<input type="hidden" id="hid_${preItemFile}" value="${item }"/>
         		</c:forEach>
            	</c:if>
            	<input type="hidden" id="hid_fileInfoPath" name="infoPath" value="${entity.infoPath }"/>
            	</div>
			</td>
      </tr>
	 </tbody>
  </table>
   <input type="hidden" id="id"  name="id" value="${entity.id}" />
  </form>
  </div>
  <script type="text/javascript" src="${ctx}/js/app-web/dict/safetyCard/safetyCardForm.js"></script>
  </body>
  </html>
  